﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:controls="clr-namespace:VSTalk.Engine.Controls"
                    xmlns:converters="clr-namespace:VSTalk.Engine.Converters">
    <converters:RoomStateToColorConverter x:Key="RoomStateToColorConverter"/>
    <Style TargetType="{x:Type controls:RoomLabel}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type controls:RoomLabel}">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>

                        <Rectangle Width="8" Height="8" Margin="6">
                            <Rectangle.Fill>
                                <VisualBrush Stretch="Fill">
                                    <VisualBrush.Visual>
                                        <Canvas Width="40"
                                                Height="40"
                                                Clip="F1 M 0,0L 48,0L 48,48L 0,48L 0,0"
                                                UseLayoutRounding="False"
                                                Margin="220,140,257,140">
                                            <Path Data="M15.333,2.5000005 L18.166,2.5000005 18.166,26.667 15.333,26.667 z M28.166,2.5 L30.999001,2.5 30.999001,26.667 28.166,26.667 z M2.5,2.5 L5.3330002,2.5 5.3330002,26.667 2.5,26.667 z"
                                                  Height="29.167"
                                                  Canvas.Left="1.501"
                                                  Stretch="Fill"
                                                  Stroke="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Context.IsActive, Converter={StaticResource RoomStateToColorConverter}}"
                                                  StrokeThickness="5"
                                                  Canvas.Top="5"
                                                  Width="33.499" />
                                        </Canvas>
                                    </VisualBrush.Visual>
                                </VisualBrush>
                            </Rectangle.Fill>
                        </Rectangle>
                        <TextBlock Grid.Column="1"
                                   Margin="5"
                                   Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Room.Name}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>